<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>脚本内联</title>
</head>
<body>
    <script th:inline="javascript">
        var msg='Hello '+[[${userName}]]+'!'
        alert(msg)
    </script>
</body>
</html>